home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1997 July / Software of the Month Club - Business (Volume 239) (July 1997).iso / pc / code / h.dxr / 00004_enter&exitKF scripts.ls next >
Encoding:
Text File  |  1996-02-15  |  6.9 KB  |  262 lines

  1. global gObjects, gCursorlist, cNullCast, gObjectsH, gStates, gWorld, sQTCharSprite, gLastKeyList, gCurKeyList, gKeyRef, gHaveNavs, sPICTSPRITE, gEnvironmentSound
  2.  
  3. on fixName startcast, endcast
  4.   set newName to "fdbcknoclog"
  5.   repeat with X = startcast to endcast
  6.     set nameOfCast to the name of cast X
  7.     set loop to 1
  8.     repeat while loop = 1
  9.       if char 1 of nameOfCast = "." then
  10.         exit repeat
  11.       end if
  12.       delete char 1 of nameOfCast
  13.     end repeat
  14.     put newName before nameOfCast
  15.     set the name of cast X to string(nameOfCast)
  16.     updateStage()
  17.   end repeat
  18. end
  19.  
  20. on castInScore startFrame, endFrame, numOfCast
  21.   repeat with X = startFrame to endFrame
  22.     go(X)
  23.     repeat with z = 1 to 48
  24.       if the castNum of sprite z = numOfCast then
  25.         put "Cast number " & numOfCast & " is in sprite channel " & z & " of frame " & X
  26.       end if
  27.     end repeat
  28.   end repeat
  29.   put "ΓÇóΓÇóΓÇó FINISHED ΓÇóΓÇóΓÇó"
  30. end
  31.  
  32. on giveCreds inAmount
  33.   if integerp(inAmount) then
  34.     setaProp(gStates, #Credits, integer(getaProp(gStates, #Credits) + inAmount))
  35.   end if
  36.   if (getaProp(gStates, #Credits) - getaProp(gStates, #Debt)) >= 15000 then
  37.     MakeDynamic(#ShortTermStock, #solved, #true)
  38.     setaProp(getaProp(gStates, #Conditions), #ShortStock, #true)
  39.   end if
  40. end
  41.  
  42. on EnterH01
  43.   if voidp(getaProp(getaProp(gStates, #BeenThere), #H01)) then
  44.     PDARelease("J06hosp.mov")
  45.   end if
  46.   checkOnEnterH()
  47. end
  48.  
  49. on enterH04
  50.   pickNurse(1)
  51. end
  52.  
  53. on exitH04
  54.   set NurseObj to getaProp(gObjects, #NurseVid)
  55.   MakeDynamic(#NurseVid, #clickCount, 1)
  56.   set curCond to getaProp(getaProp(gObjects, #NurseVid), #curCond)
  57.   if getOne(getaProp(NurseObj, #condList), curCond) = 0 then
  58.     set condList to getaProp(NurseObj, #condList)
  59.     add(condList, curCond)
  60.     MakeDynamic(#NurseVid, #condList, condList)
  61.   end if
  62.   MakeDynamic(#PaMonitor, #PINEntered, #empty)
  63. end
  64.  
  65. on calcTransToH06 Test
  66.   if Test = #Debug then
  67.     return [#H06, #H06B]
  68.   end if
  69.   pickAgent(#H06)
  70.   set agentStatus to getaProp(getaProp(gObjects, #Agent06vid), #DisplayState)
  71.   if agentStatus = #OffScreen then
  72.     return #H06
  73.   else
  74.     return #H06B
  75.   end if
  76. end
  77.  
  78. on enterH06B
  79.   set gHaveNavs to #false
  80.   Startthetimer(600, "handleAgentMovie06")
  81. end
  82.  
  83. on exitH06B
  84.   set gHaveNavs to #true
  85. end
  86.  
  87. on handleAgentMovie06
  88.   Startthetimer(the stopTime of sprite sQTCharSprite - the movieTime of sprite sQTCharSprite + 10, "jumpH06")
  89. end
  90.  
  91. on jumpH06
  92.   Jumptokey(#H06)
  93. end
  94.  
  95. on calcTransToH07 Test
  96.   if Test = #Debug then
  97.     return [#H07, #H07B]
  98.   end if
  99.   pickAgent(#H07)
  100.   set agentStatus to getaProp(getaProp(gObjects, #Agent07vid), #DisplayState)
  101.   if agentStatus = #OffScreen then
  102.     return #H07
  103.   else
  104.     return #H07B
  105.   end if
  106. end
  107.  
  108. on enterH07B
  109.   set gHaveNavs to #false
  110.   Startthetimer(600, "handleAgentMovie07")
  111. end
  112.  
  113. on handleAgentMovie07
  114.   Startthetimer(the stopTime of sprite sQTCharSprite - the movieTime of sprite sQTCharSprite + 10, "jumpH07")
  115. end
  116.  
  117. on jumpH07
  118.   Jumptokey(#H07)
  119. end
  120.  
  121. on exitH07B
  122.   set gHaveNavs to #true
  123. end
  124.  
  125. on EnterH08
  126.   if (getaProp(getaProp(gStates, #Conditions), #ShortStock) = #true) and (getaProp(gStates, #Debt) = 0) and (getaProp(getaProp(gObjects, #PaMonitor), #HospPaid) = #true) then
  127.     setAt(getaProp(getaProp(gWorld, #H08), #GOWHERE), 1, #H17)
  128.   else
  129.     setAt(getaProp(getaProp(gWorld, #H08), #GOWHERE), 1, #empty)
  130.   end if
  131. end
  132.  
  133. on EnterH09
  134.   doTextFldFormat()
  135.   set Mobj to getaProp(gObjects, #PaMonitor)
  136.   Startthetimer(30, "TurnPaMonitorON")
  137. end
  138.  
  139. on exitH09
  140.   playSound("H09monOn.aif", #keyframeCast)
  141.   DoSetToOFF()
  142.   if getaProp(getaProp(gObjects, #PaMonitor), #PINEntered) = #empty then
  143.     MakeDynamic(#PaMonitor, #PINEntered, #false)
  144.   end if
  145.   MakeDynamic(#PaPatients, #whichPatient, 0)
  146. end
  147.  
  148. on calcTranstoH11 Test
  149.   if Test = #Debug then
  150.     return [#H11B, #H11D]
  151.   end if
  152.   pickDoctor(1)
  153.   set docState to getaProp(getaProp(gObjects, #Doc11Vid), #DisplayState)
  154.   if (docState = #OffScreen) or (docState = #defibSolved1) then
  155.     return #H11D
  156.   else
  157.     return #H11B
  158.   end if
  159. end
  160.  
  161. on enterH11B
  162.   set docState to getaProp(getaProp(gObjects, #Doc11Vid), #DisplayState)
  163.   if (docState = #shrtStckSlvd) or (docState = #heartSolved) then
  164.     Startthetimer(60, "prepareNewH11BBkd", #Doc11Vid)
  165.   end if
  166. end
  167.  
  168. on enterH11D
  169.   nothing()
  170. end
  171.  
  172. on prepareNewH11BBkd
  173.   Startthetimer(the stopTime of sprite sQTCharSprite - the movieTime of sprite sQTCharSprite + 6, "setNewH11BBkd", #Doc11Vid)
  174. end
  175.  
  176. on setNewH11BBkd
  177.   set the castNum of sprite sPICTSPRITE to the number of cast "H11D.PCT"
  178.   DelObjects([#Doc11vidrect, #Doc11Vid])
  179. end
  180.  
  181. on exitH11
  182.   set doctorObj to getaProp(gObjects, #Doc11Vid)
  183.   set docState to getaProp(getaProp(gObjects, #Doc11Vid), #DisplayState)
  184.   if (docState = #shrtStckSlvd) or (docState = #heartSolved) or (docState = #messingUp) then
  185.     set gKeyRef to #H11D
  186.   end if
  187.   MakeDynamic(#Doc11Vid, #clickCount, 1)
  188.   set curCond to getaProp(getaProp(gObjects, #Doc11Vid), #curCond)
  189.   if getOne(getaProp(doctorObj, #condList), curCond) = 0 then
  190.     set condList to getaProp(doctorObj, #condList)
  191.     add(condList, curCond)
  192.     MakeDynamic(#Doc11Vid, #condList, condList)
  193.     if curCond = #defibSolved2 then
  194.       set curCond to #defibSolved1
  195.       set condList to getaProp(doctorObj, #condList)
  196.       add(condList, curCond)
  197.       MakeDynamic(#Doc11Vid, #condList, condList)
  198.     end if
  199.   end if
  200.   MakeDynamic(#Doc11vidrect, #Hotrect, [rect(318, 40, 558, 256)])
  201.   MakeDynamic(#Doc11vidrect, #curCond, #empty)
  202. end
  203.  
  204. on setDeath
  205.   MakeDynamic(#Doc11Vid, #h12Count, 5)
  206. end
  207.  
  208. on calcNavtoH12
  209.   set docState to getaProp(getaProp(gObjects, #Doc11Vid), #State)
  210.   if (docState = #Dead1) or (docState = #Dead2) or (docState = #Dead3) then
  211.     stopsound("Hambient.aif")
  212.     genexitkf(#HDie)
  213.   else
  214.     genexitkf(#H12)
  215.   end if
  216. end
  217.  
  218. on enterH12
  219.   set doctorObj to getaProp(gObjects, #Doc11Vid)
  220.   if getOne(getaProp(doctorObj, #Playlist), "H11dnd2.mov") <> 0 then
  221.     set h12Count to getaProp(doctorObj, #h12Count) + 1
  222.     MakeDynamic(#Doc11Vid, #h12Count, h12Count)
  223.   end if
  224. end
  225.  
  226. on exitH12
  227.   DoTurnDefibOFF()
  228.   MakeDynamic(#DefibPower, #State, #close)
  229. end
  230.  
  231. on calcTranstoH13
  232.   set docState to getaProp(getaProp(gObjects, #Doc11Vid), #State)
  233.   if (docState = #Dead1) or (docState = #Dead2) or (docState = #Dead3) then
  234.     stopsound("Hambient.aif")
  235.     return #HDie
  236.   else
  237.     return #H13
  238.   end if
  239. end
  240.  
  241. on calcTranstoH20
  242.   set docState to getaProp(getaProp(gObjects, #Doc11Vid), #State)
  243.   if (docState = #Dead1) or (docState = #Dead2) or (docState = #Dead3) then
  244.     stopsound("Hambient.aif")
  245.     return #HDie
  246.   else
  247.     return #H20
  248.   end if
  249. end
  250.  
  251. on checkOnEnterH
  252.   set doctorObj to getaProp(gObjects, #Doc11Vid)
  253.   if getOne(getaProp(doctorObj, #Playlist), "H11dnd1.mov") <> 0 then
  254.     if (getaProp(getaProp(gObjects, #TubeObj), #Aquired) <> #true) and (getaProp(getaProp(gObjects, #syrnObj), #Aquired) <> #true) then
  255.       MakeDynamic(#Doc11Vid, #slippingCond, #true)
  256.     end if
  257.   end if
  258.   if getOne(getaProp(doctorObj, #Playlist), "H11dps2.mov") <> 0 then
  259.     MakeDynamic(#Doc11Vid, #messingUpCond, #true)
  260.   end if
  261. end
  262.